<template>
  <div class="progress">
    <div class="text" :style="{ color: color }">
      <slot name="title"
        ><div class="title">{{ title }}</div></slot
      >
      <div class="percentage">{{ percentage }}%</div>
    </div>
    <div class="progress-bar">
      <div class="progress-status" :style="{ width: percentage + '%', backgroundColor: color }"></div>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  percentage: {
    type: Number,
    default: 0,
  },
  color: {
    type: String,
    default: "#2F80ED",
  },
  title: {
    type: String,
    default: "",
  },
  showText: {
    type: Boolean,
    default: true,
  },
});
</script>
<style lang="scss" scoped>
.progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  .text {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .progress-bar {
    width: 100%;
    height: 4px;
    background: #ffffff0d;
    .progress-status {
      height: 100%;
    }
  }
}
</style>
